package digital.store.springmvc.service;

import java.util.Collection;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import digital.store.springmvc.dao.OrderDao;
import digital.store.tutorial.springmvc.model.Orderk;

@Service
@Transactional
public class OrderService {
	 @Autowired
	 private OrderDao orderDao;
	 
	 @Transactional
	    public void saveOrUpdate(Orderk order) {
		 orderDao.saveOrUpdate(order);
		}
		    
		@Transactional
		public void delete(Long ido) {
			orderDao.delete(ido);
		}
		    
		public Collection<Orderk> findAll() {
		    return orderDao.findAll();
		}
		
		public Orderk findById(Long ido) {
		    return orderDao.findById(ido);
		}
}
